class eventEmitter{
  constructor(){
    this.event = []
  }
  on(eventName, callback) {
    if(!this.event[eventName]) {
      this.event[eventName] = [callback]
    } else {
      this.event[eventName].push(callback)
    }
  }
  emit(eventName) {
    if(this.event[eventName]) {
      this.event[eventName].forEach(f => f())
    }
  }
  remove(eventName, callback) {
    if(this.event[eventName]) {
      this.event[eventName].filter(cb => {return cb !== callback})
    }
  }
}
